package main.state;

/**
 * @author Hoan.NguyenTrong Jan 23, 2015
 * 
 */
public class Person {

    private State happyState;
    private State sadState;
    private int helloCount;

    public State getHappyState() {
	return happyState;
    }

    public void setHappyState(State happyState) {
	this.happyState = happyState;
    }

    public State getSadState() {
	return sadState;
    }

    public void setSadState(State sadState) {
	this.sadState = sadState;
    }

    private State state;

    public State getState() {
	return state;
    }

    public void setState(State state) {
	this.state = state;
    }

    public int getHelloCount() {
	return helloCount;
    }

    public Person() {
	// Default is HappyState
	this.happyState = new HappyState(this);
	this.sadState = new SadState(this);
	this.state = this.happyState;
	helloCount = 0;
    }

    public void sayHello() {
	this.state.sayHello();
	this.helloCount++;
    }

    public void sayGoodbye() {
	this.state.sayGoodbye();
    }
}
